#ifndef _PROCESS_CONTROL_H
#define _PROCESS_CONTROL_H

#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <glib.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <pthread.h>
#include <sys/mman.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>

#define MSG_QUEUE				(1)
#define SHM_SIZE 				(30)
#define MAX_CHILD_NUMBER			(10)
#define MAX_THREAD				(3)
#if 0
union semnu {
	int val;
	struct semid_ds *buf;
	unsigned short *array;
	struct seminfo *__buf;
};
#endif

#if defined(MSG_QUEUE) && (1 == MSG_QUEUE)
#define SEED		('g')				/* ftok seed */
#define SERVER		(1L)				/* server message */

typedef struct {
	long msg_to;
	long msg_fm;
	char buffer[BUFSIZ];
} MESSAGE;

#endif

extern etext;
extern edata;
extern end;

uint32_t xyos_fork(void);
int producer_consumer_pv(uint32_t pid_num);

#endif
